//File name: drawlinebot.c
 int randint(max_value){
 int a = (random()%(max_value+1));
 return a;
}
 float randfloat(max_value){
 int a = (random()%(max_value+1));
 (float) a;
 return a;
}
#define LEFT 3
#define RIGHT 0
int main()
{
	int s1, a, b;
	s1=analog10(7);
	while(1)
	{
		// printf("%d",a,"\n");
		switch(randint(4))
		{
			case 0: //line
			{
				motor(LEFT, 75);
				motor(RIGHT, 75);
				sleep(randfloat(5.0)+1.0);
			}
			case 1:// slight turn
			{
				motor(LEFT, 75);
				motor(RIGHT, 50);
				sleep(randfloat(5.0)+1.0);
			}
			case 2://Turn to right
			{
				motor(LEFT,100);
				motor(RIGHT, 0);
				sleep(randfloat(5.0)+1.0);
			}
			case 3: // slight left turn
			{
				motor(LEFT, 50);
				motor(RIGHT, 75);
				sleep(randfloat(5.0)+1.0);
			}
			case 4: // hardleft turn
			{
				motor(LEFT, 0);
				motor(RIGHT, 100);
				sleep(randfloat(5.0)+1.0);
			}
		}
		printf("Sleeping ZzZz \n");	
	}
}
